/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.UserFaxPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.IUserFaxMapper;

@Service
public class UserFaxService {
	@Autowired
	private IUserFaxMapper userFaxMapper;
	
	/**
	 * 根据ID获取UserFaxPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return UserFaxPo
	 */
	public UserFaxPo getUserFax(int id) {
		return userFaxMapper.findUserFaxById(id);
	}
	
	/**
	 * 根据条件获取UserFaxPo对象，并返回查询的数据总数
	 * 
	 * @param userFax
	 * @Author 迷蝶
	 * @return ResultPageTo<UserFaxPo>
	 */
	public ResultPageTo<UserFaxPo> getUserFaxs(UserFaxPo userFax) {
		return new ResultPageTo<UserFaxPo>(userFax.getStart(), userFax.getSize(), 
				userFaxMapper.findUserFaxCount(userFax), userFaxMapper.findUserFaxs(userFax));
	}
	
	/**
	 * 根据ID删除UserFaxPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delUserFax(int id) {
		return userFaxMapper.delUserFaxById(id);
	}
	
	/**
	 * 增加UserFaxPo对象
	 * 
	 * @param userFax
	 * @Author 迷蝶
	 */
	public Integer addUserFax(UserFaxPo userFax) {
		return userFaxMapper.addUserFax(userFax);
	}
	
	/**
	 * 根据条件更新UserFaxPo对象
	 * 
	 * @param userFax
	 * @Author 迷蝶
	 */
	public Integer updateUserFax(UserFaxPo userFax) {
		return userFaxMapper.updateUserFax(userFax);
	}
	
}
